package com.hsc.yalebao.adapter;

import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.model.AmountRecordBaseModel;
import com.hsc.yalebao.tools.UiUtil;
import java.util.ArrayList;
import java.util.HashMap;

public class AccountChangeListAdapter extends BaseAdapter
{
  String TAG = "AccountChangeListAdapter";
  private Context context;
  int count = 1;
  ViewHolder holder = null;
  private LayoutInflater inflater;
  int itemWidth;
  private ArrayList<AmountRecordBaseModel> list;
  HashMap<Integer, View> mapView = new HashMap();
  private String savePoint;
  int screenWidth;

  public AccountChangeListAdapter(Context paramContext, ArrayList<AmountRecordBaseModel> paramArrayList)
  {
    this.context = paramContext;
    this.inflater = LayoutInflater.from(paramContext);
    this.list = paramArrayList;
    this.screenWidth = CustomApplication.app.displayMetrics.widthPixels;
    this.itemWidth = ((this.screenWidth - 2 * UiUtil.dip2px(paramContext, 10.0F)) / 3);
  }

  public int getCount()
  {
    if (this.list == null)
      return 0;
    return this.list.size();
  }

  public Object getItem(int paramInt)
  {
    return this.list.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    if (paramView == null)
    {
      this.holder = new ViewHolder();
      paramView = this.inflater.inflate(2130903135, null);
      this.holder.tv_change_time = ((TextView)paramView.findViewById(2131100136));
      this.holder.tv_change_jine = ((TextView)paramView.findViewById(2131100138));
      this.holder.tv_change_type = ((TextView)paramView.findViewById(2131100140));
      this.holder.tv_change_qihao = ((TextView)paramView.findViewById(2131100141));
      LinearLayout localLinearLayout1 = (LinearLayout)paramView.findViewById(2131100135);
      LinearLayout localLinearLayout2 = (LinearLayout)paramView.findViewById(2131100137);
      LinearLayout localLinearLayout3 = (LinearLayout)paramView.findViewById(2131100139);
      ViewGroup.LayoutParams localLayoutParams = localLinearLayout1.getLayoutParams();
      localLayoutParams.width = this.itemWidth;
      localLinearLayout1.setLayoutParams(localLayoutParams);
      localLinearLayout2.setLayoutParams(localLayoutParams);
      localLinearLayout3.setLayoutParams(localLayoutParams);
      ViewHolder localViewHolder = this.holder;
      paramView.setTag(localViewHolder);
    }
    AmountRecordBaseModel localAmountRecordBaseModel;
    while (true)
    {
      localAmountRecordBaseModel = (AmountRecordBaseModel)this.list.get(paramInt);
      if (localAmountRecordBaseModel != null)
        break;
      return paramView;
      this.holder = ((ViewHolder)paramView.getTag());
    }
    String str1 = localAmountRecordBaseModel.getAdd_time();
    String str2 = localAmountRecordBaseModel.getValue();
    String str3 = localAmountRecordBaseModel.getRemark();
    String str4 = localAmountRecordBaseModel.getType();
    String[] arrayOfString = str1.trim().split(" ");
    this.holder.tv_change_time.setText(arrayOfString[0] + "\n" + arrayOfString[1]);
    double d = 0.0D;
    try
    {
      UiUtil.savePoint(d, 2);
      d = Double.parseDouble(str2);
      this.savePoint = UiUtil.savePoint(d, 2);
      if (d > 0.0D)
      {
        this.holder.tv_change_jine.setText("+" + this.savePoint);
        this.holder.tv_change_jine.setTextColor(this.context.getResources().getColor(2131165214));
        if (!"1".equals(str4))
          break label470;
        this.holder.tv_change_type.setText("充值");
        this.holder.tv_change_qihao.setText(str3);
        return paramView;
      }
    }
    catch (NumberFormatException localNumberFormatException)
    {
      while (true)
      {
        localNumberFormatException.printStackTrace();
        continue;
        this.holder.tv_change_jine.setText(this.savePoint);
        this.holder.tv_change_jine.setTextColor(this.context.getResources().getColor(2131165321));
        continue;
        label470: if ("2".equals(str4))
          this.holder.tv_change_type.setText("投注");
        else if ("3".equals(str4))
          this.holder.tv_change_type.setText("中奖");
        else if ("4".equals(str4))
          this.holder.tv_change_type.setText("回水");
        else if ("5".equals(str4))
          this.holder.tv_change_type.setText("赠送");
        else if ("6".equals(str4))
          this.holder.tv_change_type.setText("提现");
        else if ("7".equals(str4))
          this.holder.tv_change_type.setText("代理商返利");
        else if ("8".equals(str4))
          this.holder.tv_change_type.setText("提现驳回");
        else if ("9".equals(str4))
          this.holder.tv_change_type.setText("转账");
        else if ("10".equals(str4))
          this.holder.tv_change_type.setText("扣款");
        else if ("11".equals(str4))
          this.holder.tv_change_type.setText("撤单");
        else if ("12".equals(str4))
          this.holder.tv_change_type.setText("介绍佣金");
        else if ("13".equals(str4))
          this.holder.tv_change_type.setText("红包");
        else
          this.holder.tv_change_type.setText("其它");
      }
    }
  }

  public void setData(ArrayList<AmountRecordBaseModel> paramArrayList)
  {
    this.list = paramArrayList;
  }

  public class ViewHolder
  {
    private TextView tv_change_jine;
    private TextView tv_change_qihao;
    public TextView tv_change_time;
    private TextView tv_change_type;

    public ViewHolder()
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.adapter.AccountChangeListAdapter
 * JD-Core Version:    0.6.2
 */